Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
mjml-validator
Advanced tools
MJML provides a validation layer that helps you building your email. It can detect if you misplaced or mispelled a MJML component, or if you used any unauthorised attribute on a specific component. It supports 3 levels of validation:
skip
: your document is rendered without going through validationsoft
: your document is going through validation and is rendered, even if it has errorsstrict
: your document is going through validation and is not rendered if it has any errorBy default, the level is set to soft
.
When using the mjml
command line, you can add the option -c.validationLevel
or --config.validationLevel
with the validation level you want.
Set the validation level to
skip
(so that the file is not validated) and render the file
mjml --config.validationLevel=skip template.mjml
Alternatively, you can just validate file without rendering it by add ing the --validate
option
mjml --validate template.mjml
In Javascript, you can provide the level through the options
parameters on mjml2html
. Ex: mjml2html(inputMJML, { validationLevel: 'strict' })
strict
will raise a MJMLValidationError
exception. This object has 2 methods:
getErrors
returns an array of objects with line
, message
, tagName
as well as a formattedMessage
which contains the line
, message
and tagName
concatenated in a sentence.getMessages
returns an array of formattedMessage
.When using soft
, no exception will be raised. You can get the errors in the object returned by mjml2html
. It is the same object returned by getErrors
on strict mode.
FAQs
mjml-validator
The npm package mjml-validator receives a total of 515,804 weekly downloads. As such, mjml-validator popularity was classified as popular.
We found that mjml-validator demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.